import { Controller, Get, Post, Body, Query } from '@nestjs/common';
import { IncomeService } from './income.service';
import { CreateDto } from './dto/create.dto'
import { GetIncomesDto } from './dto/get-income.dto'
import { RemoveDto } from './dto/remove.dto'
import { UpdateDto } from './dto/update.dto'

@Controller('incomes')
export class IncomeController {
  constructor(private readonly incomeService: IncomeService) { }

  @Post("createIncome")
  async createIncome(@Body() createDto: CreateDto) {
    return this.incomeService.createIncome(createDto);
  }

  @Get("getIncomesByBillId")
  async getIncomes(@Query() getIncomesDto: GetIncomesDto) {
    return this.incomeService.getIncomesByBillId(getIncomesDto);
  }

  @Post("updateIncomeByDataId")
  async updateIncomeByDataId(@Body() updateDto: UpdateDto) {
    return this.incomeService.updateIncomeByDataId(updateDto);
  }

  @Post("removeIncomesByDataIds")
  async removeIncomesByDataIds(@Body() removeDto: RemoveDto) {
    return this.incomeService.removeIncomesByDataIds(removeDto);
  }

}